package com.jzo2o.market.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jzo2o.api.market.dto.request.CouponUseBackReqDTO;
import com.jzo2o.api.market.dto.request.CouponUseReqDTO;
import com.jzo2o.api.market.dto.response.AvailableCouponsResDTO;
import com.jzo2o.api.market.dto.response.CouponDto;
import com.jzo2o.api.market.dto.response.CouponUseResDTO;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.market.model.domain.Coupon;
import com.jzo2o.market.model.dto.request.CouponOperationPageQueryReqDTO;
import com.jzo2o.market.model.dto.request.SeizeCouponReqDTO;
import com.jzo2o.market.model.dto.response.ActivityInfoResDTO;
import com.jzo2o.market.model.dto.response.CouponInfoResDTO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author itcast
 * @since 2023-09-16
 */
public interface ICouponService extends IService<Coupon> {


    List<ActivityInfoResDTO> selectCountByActivetyId(Set<Long> set);

    PageResult<CouponInfoResDTO> pageQuery(CouponOperationPageQueryReqDTO dto);

    List<CouponInfoResDTO> myCoupon(Integer status, Long lastId);

    /**
     * 抢券接口
     * @param seizeCouponReqDTO
     */
    void seizeCoupon(SeizeCouponReqDTO seizeCouponReqDTO);

    /**
     * 获取可用优惠券列表
     * @param totalAmount
     * @return
     */
    List<AvailableCouponsResDTO> getAvailable(BigDecimal totalAmount);

    CouponUseResDTO use(CouponUseReqDTO couponUseReqDTO);

    /**
     * 退回优惠券
     * @param couponUseBackReqDTO
     */
    void useBack(CouponUseBackReqDTO couponUseBackReqDTO);

    CouponDto getCouponByOrdersId(Long ordersId);
}
